<%--
XPTracker - Alternative Agile Tracking Tool
Copyright (C) 2006-2009  Stephen Starkey

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
--%>
<%@ include file="taglibs.jsp" %>
<s:layout-render name="/layout/normal.jsp">
  <s:layout-component name="body">
    <h2>
    <s:url beanclass="org.xptracker.web.TimeSegmentActionBean" var="url" scope="request"/>

    <s:link beanclass="org.xptracker.web.TimeSegmentsActionBean">
      ${actionBean.timeline.name}
      <s:param name="timelineId" value="${actionBean.timeline.id}"/>
    </s:link> /
    ${actionBean.segment.name} (<fmt:formatDate value="${actionBean.segment.startDate}" dateStyle="short"/> -
      <fmt:formatDate value="${actionBean.segment.stopDate}" dateStyle="short"/>)</h2>
    <s:url beanclass="org.xptracker.web.ChartActionBean" var="chartUrl"/>
    <img src="${chartUrl}?id=${actionBean.chartUuid}&width=800&height=240" alt="Segment Burn"/>

    <div>
      <span id="summaryLink" class="" style="display:none">
        <a href="#" onclick="toggleLinks()">Summary</a>
      </span>
      <span id="summaryText">
        Summary
      </span>
      <span id="effortLink">
        <a href="#" onclick="toggleLinks()">Effort</a>
      </span>
      <span id="effortText" style="display:none">
        Effort
      </span>

      <span id="segmentSummary">
        <jsp:include page="timeSegmentSummary.jsp"/>
      </span>

      <span id="segmentEffort" style="display:none">
        <jsp:include page="timeSegmentEffort.jsp"/>
      </span>
    </div>

    <script type="text/javascript">
      function toggleLinks() {
        ["segmentSummary", "segmentEffort", "summaryLink", "effortLink", "summaryText", "effortText"].each(function(id) {
          Element.toggle(id);
        })
      }
    </script>
  </s:layout-component>
</s:layout-render>